<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head></h:head> 
<body> 
        <ui:composition template="../template.xhtml">
            <ui:define name="content">
				<h:form id="search">
					<p:panel header="Modifica pacchetto (Step 1/2)">
							<h:panelGrid columns="3">
								<h:outputLabel for="name">Nome</h:outputLabel>
					    		<p:inputText id="name" value="#{packetBackend.current.name}" required="true"></p:inputText>
							    <p:message for="name" />
							
								<h:outputLabel for="place">Destinazione*</h:outputLabel>
						        <h:selectOneMenu id="place" value="#{packetBackend.current.place.name}" required="true" requiredMessage="Scegliere un luogo di destinazione">
			                		<f:selectItem itemLabel="scegli una destinazione" itemValue="" />
			                		<f:selectItems value="#{util.getPlaceListOptions()}" />
							    </h:selectOneMenu>
							    <p:message for="place" />
							    
							    <h:outputLabel for="startingDate">Data di inizio*</h:outputLabel>
								<p:calendar id="startingDate" binding="#{startDateComponent}" value="#{packetBackend.current.startingDate}" pattern="MM/dd/yyyy" required="true" />
								<p:message for="startingDate" />
							    
							    <h:outputLabel for="endingDate">Data di fine*</h:outputLabel>
								<p:calendar id="endingDate" value="#{packetBackend.current.endingDate}" pattern="MM/dd/yyyy" required="true">
								    <f:validator validatorId="dateRangeValidator" />
								    <f:attribute name="startDateComponent" value="#{startDateComponent}" />
								</p:calendar>
								<p:message for="endingDate" />
								
								
								<h:outputLabel for="discount">Sconto (percentuale)</h:outputLabel>
					    		<p:inputText id="discount" value="#{packetBackend.discount}" required="true"></p:inputText>
							    <p:message for="discount" />
								
								<h:commandButton value="Continua modifica pacchetto" action="#{packetBackend.editActionStep2}" />
							</h:panelGrid>
					</p:panel>
				</h:form>
            
            
            </ui:define>
        </ui:composition>

</body> 
</html>
